<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>通达网络办公系统</title>
<link href="<?php echo base_url()?>css/base.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url()?>css/common.css" type="text/css" rel="stylesheet" />
<link href="<?php echo base_url()?>css/pages.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo base_url()?>js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="<?php echo base_url()?>js/Clock.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>/js/menu.js"></script>
<!--[if lte IE 6]>
<script type="text/javascript" src="js/DD_belatedPNG.js"></script>
    <script type="text/javascript">
        DD_belatedPNG.fix('*');
    </script>
<![endif]-->
</head>
<script type="text/javascript">
<!--
	function sub(){
		var formtext = $("input[name='formtext']").val();
		if(formtext == ''){
			$("#formtext_msg").html("不能为空！");
			return false;
		}else{
			$("#formtext_msg").html("");
		}
		var fieldname = $("input[name='fieldname']").val();
		var classid = $("input[name='classid']").val()
		if(fieldname == ''){
			$("#fieldname_msg").html("不能为空！");
		}else{
			$("#fieldname_msg").html("");
			var showmsg = false;
			$.ajax({
				type: "POST",
				async:false, 
				url: "<?php echo site_url('article/checkfieldname')?>/",
				data: "fieldname="+fieldname+"&classid="+classid,
				success: function(msg){
					if(msg==1){
						showmsg =false;
					}else{
						showmsg =true;
					}
				}
			});
			if(!showmsg){
				$("#fieldname_msg").html("字段名称重复！");
				return showmsg;
			}
			
		}
		return true;


	}
//-->
</script>
<body>
<!-- OAindex{ -->
<div class="oaindex">
	<?php include_once('system_header.php'); ?>
    <div class="clearfix">
       <?php include_once('system_left.php'); ?>
	   <div class="right_box">
            <div class="the_current">
				<span></span>
				<p>当前位置：首页&nbsp&nbsp>>&nbsp&nbsp内容</p>
            </div>
			<div class="ou_butpos">
            	<form method="post" action="/index.php/article/insertlog/<?php echo $num?>" onsubmit="return sub()">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td class="table_left">表单提示文字：</td>
                        <td>
                          <input type="text"  name="formtext" /><span style="color:#FF0000; margin-left:5px" id="formtext_msg">*</span>
                        </td>
                      </tr>
                      <tr>
                        <td class="table_left">字段名称：</td>
                        <td class="big_input"><input type="text" name="fieldname" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')"/><span style="color:#FF0000; margin-left:5px" id="fieldname_msg" >*</span><br><font color="#999999">只能用英文字母或数字，数据表的真实字段名。</font></td>
                      </tr>
                    
                      <tr>
                        <td class="table_left">数据类型：</td>
                        <td class="state"><?php foreach($result as $item):?>
							<label><input type="radio" name="datatypeid" <?php if($item->text == '单行文本'){?> checked <?php }?> value="<?php echo $item->id?>"><span><?php echo $item->text;?></span></label>
							<?php endforeach;?></td>
                      </tr>
                      <tr>
                        <td class="table_left">默认值：</td>
                        <td><textarea name="vdefault" rows="2" cols="20">&nbsp;</textarea><br><font color="#999999">如果定义数据类型为select、radio、checkbox时，此处填写被选择的项目(用“,”分开，如“男,女,人妖”)。</font> </td>
                      </tr>
                      <tr>
                        <td class="table_left">最大长度：</td>
                        <td><input type="text" value="250" name="fieldlength"/><br><font color="#999999">文本数据必须填写，大于255为text类型</font></td>
                      </tr>                     
                      <tr>
                        <td></td>
                        <td class="function_button"><input type="hidden" name="classid" value="<?php echo $num?>"><input type="submit" value="提交" /><input type="reset" value="重置" /><a href="javascript:history.go(-1);">返回</a></td>
                      </tr>
                    </table>
                 </form>
			</div>
        </div>
        <!-- }right_box -->
    </div>
</form>
	<?php include_once( 'system_footer.php' )?>
</div>
<!-- }OAindex -->
</body>
</html>

